﻿using System.Collections.Generic;
using System.ComponentModel;
using GIMS.Def.Arguments;
using GIMS.Def.Flags;
using GIMS.Def.Settings;

namespace GIMS.Def.Operators
{
    public class DrawOperator : Operator
    {
        private FillSetting fillSetting;
        private StrokeSetting strokeSetting;
        private StrokeWidthSetting strokeWidthSetting;

        public DrawOperator()
        {
            name = "Draw";
            description = "Draws a shape on a given image";
            instruction = "-draw";
            iconPath = @"Images\draw.png";
            argument = new DrawArgument();
            possiblePrograms = Program.convert;
            position = Position.Between;               
            fillSetting = new FillSetting();
            fillSetting.Description = "The shape is filled with the given color";
            strokeSetting = new StrokeSetting();
            strokeSetting.Description = "Coloring of the shape border";
            strokeWidthSetting = new StrokeWidthSetting();
            strokeWidthSetting.Description = "width of the shape border";
            settings = new List<Setting>{ fillSetting, strokeSetting, strokeWidthSetting };

            argument.PropertyChanged += new PropertyChangedEventHandler(OnArgumentChanged);
            fillSetting.Argument.PropertyChanged += new PropertyChangedEventHandler(OnArgumentChanged);
            strokeSetting.Argument.PropertyChanged += new PropertyChangedEventHandler(OnArgumentChanged);     
            strokeWidthSetting.Argument.PropertyChanged += new PropertyChangedEventHandler(OnArgumentChanged);
            fillSetting.PropertyChanged += new PropertyChangedEventHandler(OnSettingChanged);
            strokeSetting.PropertyChanged += new PropertyChangedEventHandler(OnSettingChanged);
            strokeWidthSetting.PropertyChanged += new PropertyChangedEventHandler(OnSettingChanged);
        }
    }
}
